USE [GD2C2013]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE FUNCTION [vacuna_gdd].[buscarPlanAfiliado](@nombreUsuario varchar(25))
        
RETURNS int

AS BEGIN

DECLARE @plan int

SELECT @plan = afil_plan_medico
FROM vacuna_gdd.Afiliado
WHERE afil_username = @nombreUsuario

RETURN @plan
END


